from org.jyrcp.base import Platform

if Platform.PLATFORM == 'RCP':
    from org.eclipse.ui.application import ActionBarAdvisor
else:
    from org.eclipse.ui.entrypoint import ActionBarAdvisor

from org.eclipse.ui.actions import ActionFactory
from org.eclipse.jface.action import MenuManager

from actions.change_perspective import ChangePerspective

class JyRCPActionBarAdvisor(ActionBarAdvisor):
    def makeActions(self, window):
        self.exit_action = ActionFactory.QUIT.create(window)
        self.change_perspective_action = ChangePerspective(window)
        
    def fillMenuBar(self, menu_bar):
        file_menu = MenuManager('File')
        file_menu.add(self.exit_action)
        file_menu.add(self.change_perspective_action)
        menu_bar.add(file_menu);